import axios from "axios";
import { CHANGEGOODPRICE } from "./constants";

export const changeGoodprice = (goodPrice) =>({
  type:CHANGEGOODPRICE,
  goodPrice
})

export const fetchHomeData = () =>{
  return async (dispatch,getState) =>{
   let res = await axios.get('http://codercba.com:1888/airbnb/api/home/goodprice')
    console.log(res.data.list)
    let list = res.data.list
    dispatch(changeGoodprice(list))
  }
}